<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/12
  Time: 16:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登记审核</title>
</head>
<body>
        <div class="container" style="height:50%;">
            <table class="table" id="warehousingexaminetab"></table>
        </div>
        <!---审核模态框-->
        <div class="modal fade"  tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="warehousingexaminemodal">
            <div class="modal-dialog modal-lg">
                <div class="modal-content" id="warehousingexaminezhd">

                </div>
            </div>
        </div>
        <script>
           $(function () {
               //加载所以的登记等待审核的入库产品
               $("#warehousingexaminetab").bootstrapTable({
                   url:"queryByWarehousingexaminepage.actiomn",
                   method:'post',                      //请求方式（*）
                   contentType:"application/x-www-form-urlencoded", //如果用tomcat就要写这个
                   striped: true,//是否显示隔行变色
                   cache: false,//是否缓存
                   pagination: true,//是否显示分页
                   sortable: true,//是否显示排序
                   sortOrder: "aso",//排序方式
                   sidePagination:"server", //分页方式：client客户端分页，server服务端分页（*）
                   pageNumber: 1,//初始化加载第一页，默认第一页,并记录
                   pageSize: 5,//每页记录数
                   pageList: [5, 10, 15, 20],//可供选择的每页的行数（*）
                   search: false,//是否显示输入框
                   strictSearch: true,
                   showColumns: true,//是否显示所有的列（选择显示的列）
                   showRefresh: true,//是否显示刷新按钮
                   minimumCountColumns: 2,//最少允许的列数
                   clickToSelect: true,//是否启用点击选中行
                   showToggle: true,//是否显示详细视图和列表视图的切换按钮
                   cardView: false,//是否显示详细视图
                   detailView: false,//是否显示父子表
                   //获取查询到的参数
                   queryParams: function (params) {
                       var warehousinggexamine= {
                           pagesize:params.limit,
                           pageno:(params.offset/params.limit)+1,
                           sort:params.sort,
                           sortOrder:params.sort,
                       }
                       return warehousinggexamine
                   },
                   columns:[
                       {
                           field:"gatherId",
                           title:"入库单编号",
                       },
                       {
                           field:"reason",
                           title:"入库理由",
                           formatter:function (value,row,index) {
                               if(row.reason=="R001-1"){
                                   return  "生产入库";
                               }
                               if(row.reason=="R001-2"){
                                   return"库存初始";
                               }
                               if(row.reason=="R001-3"){
                                   return "赠送";
                               }
                               if(row.reason=="R001-4"){
                                   return "内部归还";
                               }
                               if(row.reason=="R001-5"){
                                   return "其他归还";
                               }
                           }
                       },
                       {
                           field:"registerTime",
                           title:"登记时间",
                       },
                       {
                           field:"amountSum",
                           title:"总件数",
                       },
                       {
                           field:"costPriceSum",
                           title:"总金额(元)",
                       },
                       {
                           field:"",
                           title:"审核",
                           formatter:function (value,row,index) {
                               return "<input type='button' value='复核' onclick='warehousingexamiebtn("+row.gatherId+")' class='btn btn-success'>";
                           }
                       }
                   ]
               })
           })
            
            function warehousingexamiebtn(gatherId) {
                $("#warehousingexaminezhd").load("warehousingexaminemodal.jsp",{"gatherId":gatherId})
                $("#warehousingexaminemodal").modal("show")
           }
        </script>
</body>
</html>
